package com.ruoyi.web.cp.domain.rm;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author xiesm
 * @Description: TODO
 * @date 2025-07-20 09:24
 */
@Data
@NoArgsConstructor
public class RmobMerge {
    private Integer id;          // 主键
    private String gameId;       // 游戏id
    private Date date;             // 日期
    private String detailsJson;             // 日期
    private JSONArray details;     // 详情

    public RmobMerge(String gameId, Date date) {
        this.gameId = gameId;
        this.date = date;
        details = new JSONArray();
    }

    public String getDetailsJson() {
        return JSON.toJSONString(this.details);
    }

    public JSONArray getDetailsJsonToJSON() {
        return JSONObject.parseArray(this.detailsJson);
    }

    @Data
    public static class Detail {
        private String score;
        private String rm_plv;
        private String ob_plv;
        private String fit;

        public Detail(String score, String rm_plv, String ob_plv, String fit) {
            this.score = score;
            this.rm_plv = rm_plv;
            this.ob_plv = ob_plv;
            this.fit = fit;
        }
    }
}
